<?php

include ("connect.php");
$dbname = 'Transportation';
mysql_select_db($dbname);

if (isset($_POST["name"]))
{ 
	
	$username = $_POST["name"];
	$password = $_POST["pass"];
	      
		   
	$sqlstr = "select * from users where Name = '$username' ";
	
	$sqlresult = mysql_query($sqlstr);
		
		
if($row = mysql_fetch_array($sqlresult)) 
{	

	if($row["Password"]==$password)
	{
		$_SESSION['userid'] = $_POST["name"];
		header('location: officer_index.php');
	}
	else
	{
		echo"<p class = 'red-text-regular'> The password is not correct </p>";
	}
}
else
{
	echo"<p class = 'red-text-regular'> The user name does not exist </p>";
}
}

?>